-- _____ ______   ________  ________   ___  _________  ________  ________          ___  ___  _________  ___  ___
--|\   _ \  _   \|\   __  \|\   ___  \|\  \|\___   ___\\   __  \|\   __  \        |\  \|\  \|\___   ___\\  \|\  \
--\ \  \\\__\ \  \ \  \|\  \ \  \\ \  \ \  \|___ \  \_\ \  \|\  \ \  \|\  \       \ \  \\\  \|___ \  \_\ \  \ \  \
-- \ \  \\|__| \  \ \  \\\  \ \  \\ \  \ \  \   \ \  \ \ \  \\\  \ \   _  _\       \ \  \\\  \   \ \  \ \ \  \ \  \
--  \ \  \    \ \  \ \  \\\  \ \  \\ \  \ \  \   \ \  \ \ \  \\\  \ \  \\  \|       \ \  \\\  \   \ \  \ \ \  \ \  \____
--   \ \__\    \ \__\ \_______\ \__\\ \__\ \__\   \ \__\ \ \_______\ \__\\ _\        \ \_______\   \ \__\ \ \__\ \_______\
--    \|__|     \|__|\|_______|\|__| \|__|\|__|    \|__|  \|_______|\|__|\|__|        \|_______|    \|__|  \|__|\|_______|
--
-- banner online tools
-- https://www.bootschool.net/ascii;bsid=FB5C2059677902AEBA0B2640589E9FE8

local require  = require;
local ngx      = ngx;
local debug    = debug;
local string   = string;
local tonumber = tonumber;
local setmetatable = setmetatable
local pairs    = pairs
local type     = type
local table    = table

local string_sub   = string.sub
local string_find  = string.find


--- 性能监控公共函数库

local _M = { _VERSION = '0.43.1' }



function _M.string_match(str, patten)
	local i, j = string_find(str, patten)
	local ret = string_sub(str, i, j)
	return ret
end

function _M.string_match_num(str, patten)
	local ret = _M.string_match(str,patten)
	local i, j = string_find(ret, "[0-9]+%.*[0-9]*")
	local num = string_sub(ret, i, j)
	return num
end


return _M;
